package cn.com.shopec.erp.provideinterface.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * @ClassName InventoryChange
 * @Description 库存异动实体
 * @author chengui
 * @date 2013-6-20 上午10:28:24
 */
@Entity
@Table(name = "tbl_inventory_change")
public class InventoryChange implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6800727240466989580L;
	
	/** 主键. */
	private String id;
	/** WMS主键. */
	private String wmsId;
	/** 仓库编码. */
	private String warehouseCode;
	/** 订单号. */
	private String orderNo;
	/** 模块编码、0001:其他入库、0002:其他出库、0003:采购入库、0004:库内盘点、0005:调拨入库、0006:调拨出库、0007:配货单出库、0008:销售退货入库、0009:采购退货出库. */
	private String moduleCode;
	/** 货品编码. */
	private String sku;
	/** 数量. */
	private String qty;
	/** 审核人. */
	private String auditor;
	/** 审核时间. */
	private String auditTime;
	/** 备注. */
	private String remark;
	/**抓取:0-未抓取，1-已抓取**/
	private String isGrab; 
	/** WMS订单号. */
	private String PINo;
	
	/** 同步状态 **/
	private String synchState;
	
	
	public InventoryChange() {
		super();
	}
	public InventoryChange(String id) {
		super();
		this.id = id;
	}
	public InventoryChange(String id, String wmsId, String warehouseCode,
			String orderNo, String moduleCode, String sku, String qty,
			String auditor, String auditTime, String remark, String isGrab) {
		super();
		this.id = id;
		this.wmsId = wmsId;
		this.warehouseCode = warehouseCode;
		this.orderNo = orderNo;
		this.moduleCode = moduleCode;
		this.sku = sku;
		this.qty = qty;
		this.auditor = auditor;
		this.auditTime = auditTime;
		this.remark = remark;
		this.isGrab = isGrab;
	}
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 50)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Column(name = "wms_id", unique = true, nullable = false, length = 50)
	public String getWmsId() {
		return wmsId;
	}
	public void setWmsId(String wmsId) {
		this.wmsId = wmsId;
	}
	@Column(name = "wh_code")
	public String getWarehouseCode() {
		return warehouseCode;
	}
	public void setWarehouseCode(String warehouseCode) {
		this.warehouseCode = warehouseCode;
	}
	@Column(name = "order_no")
	public String getOrderNo() {
		return orderNo;
	}
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	@Column(name = "module_code")
	public String getModuleCode() {
		return moduleCode;
	}
	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}
	@Column(name = "sku")
	public String getSku() {
		return sku;
	}
	public void setSku(String sku) {
		this.sku = sku;
	}
	@Column(name = "qty")
	public String getQty() {
		return qty;
	}
	public void setQty(String qty) {
		this.qty = qty;
	}
	@Column(name = "auditor")
	public String getAuditor() {
		return auditor;
	}
	public void setAuditor(String auditor) {
		this.auditor = auditor;
	}
	@Column(name = "audit_time")
	public String getAuditTime() {
		return auditTime;
	}
	public void setAuditTime(String auditTime) {
		this.auditTime = auditTime;
	}
	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	@Column(name="ISGRAD")
	public String getIsGrab() {
		return isGrab;
	}
	public void setIsGrab(String isGrab) {
		this.isGrab = isGrab;
	}
	@Column(name="pi_no")
	public String getPINo() {
		return PINo;
	}
	public void setPINo(String pINo) {
		PINo = pINo;
	}
	
	@Column(name="SYNCH_STATE")
	public String getSynchState() {
		return synchState;
	}
	public void setSynchState(String synchState) {
		this.synchState = synchState;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((wmsId == null) ? 0 : wmsId.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		InventoryChange other = (InventoryChange) obj;
		if (wmsId == null) {
			if (other.wmsId != null)
				return false;
		} else if (!wmsId.equals(other.wmsId))
			return false;
		return true;
	}
	
}
